package com.woniuxy.microsportsserver.bean;


import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * indexName 是指定索引类型 类似于表
 * Document  每一个类型都是一个文档
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@Document(indexName = "device")
public class DeviceInfo implements Serializable {
    /**
     * @Id 标识属性是id属性
     */
    @Id
    private Long id;
    /**
     * 名称
     * ik_smart 粗粒度的拆分
     */
    @Field(analyzer = "ik_smart",type = FieldType.Text)
    private String deviceName;
    @Field(type = FieldType.Keyword)
    private String deviceBrand;
    @Field(analyzer = "ik_smart",type = FieldType.Text)
    private String deviceType;
    /**
     * 设备的描述
     * ik_max_word 细粒度的拆分
     */
    @Field(analyzer = "ik_max_word",type = FieldType.Text)
    private String deviceDesc;
}
